import { PropsWithChildren } from "react";
import Taro, { useLaunch } from "@tarojs/taro";

import "@/app.scss";
import "@taroify/icons/index.scss";
import "@taroify/core/index.scss";

function App({ children }: PropsWithChildren<any>) {
  useLaunch(() => {
    console.log("App launched.");
    Taro.loadFontFace({
      family: "app",
      // source: `url("${process.env.TARO_APP_API}/statics/AaFengKuangYuanShiRen.ttf")`,
      source: `url("localhost:9999/statics/font/app.ttf")`,
    }).then((res) => {
      console.log(res);
    });
  });
  // const { theme, toggleTheme } = useTheme(); // 获取主题和切换函数
  return <>{children}</>;
}

export default App;
